package com.cskaoyan.exception;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionControllerAdvice {

    @ExceptionHandler(MyValidationException.class)
    public BaseRespVo valid(MyValidationException exception) {
        String message = exception.getMessage();
        return BaseRespVo.fail(message);
    }
}
